<%--
  Created by IntelliJ IDEA.
  User: 群威
  Date: 2017/10/18
  Time: 21:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="common/tag.jsp"%>
<html>
<head>
    <title>编辑员工</title>
    <%@ include file="common/head.jsp"%>
</head>
<body>
<caption>编辑员工</caption>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-3 column">
            <form role="form">
                <div class="form-group">
                    <label for="ename">姓名：</label><input class="form-control" id="ename" type="text" value="${employee.ename}"/>
                </div>
                <div class="form-group" id="egenderRadio">
                    <label style="display: block">性别：</label>
                    <label class="radio-inline"><input type="radio" name="egender" id="egender1" value="男" checked>男</label>
                    <label class="radio-inline"><input type="radio" name="egender" id="egender2" value="女">女</label>
                </div>
                <div class="form-group">
                    <label for="edepartment" style="display: block">部门：</label>
                    <select id="edepartment" >
                        <option value="${employee.edepartment.did}" selected>${employee.edepartment.dname}</option>
                        <c:forEach var="departmentList" items="${departmentList}">
                            <option value="${departmentList.did}">${departmentList.dname}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group">
                    <label for="erole" style="display: block">职位：</label>
                    <select id="erole">
                        <option value="${employee.erole.rid}" selected>${employee.erole.rname}</option>
                        <c:forEach var="roleList" items="${roleList}">
                            <option value="${roleList.rid}">${roleList.rname}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group">
                    <label for="enumber" style="display: block">员工编号：</label>
                    <input class="form-control" id="enumber" type="text" value="${employee.enumber}">
                </div>
                <div class="form-group">
                    <label for="eusername" style="display: block">用户名：</label>
                    <input class="form-control" id="eusername" type="text" value="${employee.eusername}"/>
                </div>
                <div class="form-group">
                    <label for="ebirthday" style="display: block">出生日期：</label>
                    <input id="ebirthday" class="form-control" type="date" value="<fmt:formatDate value="${employee.ebirthday}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker()">
                </div>
                <div class="form-group">
                    <label for="ejoindate" style="display: block">入职日期：</label>
                    <input id="ejoindate" class="form-control" type="date" value="<fmt:formatDate value="${employee.ejoindate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker()">
                </div>
            </form>
            <button class="btn btn-default" onclick="javascript:ManagerSystem.updatePage.updateEmployee({
                    eid:${employee.eid},
                    ename:$('#ename').val(),
                    egender:$('#egenderRadio input[name=egender]:checked').val(),
                    edepartment:$('#edepartment option:selected').val(),
                    erole:$('#erole option:selected').val(),
                    enumber:$('#enumber').val(),
                    eusername:$('#eusername').val(),
                    ebirthday:$('#ebirthday').val(),
                    ejoindate:$('#ejoindate').val(),
                    rid:${rid},
                    did:${did}
                    })">保存</button>
            <button class="btn btn-default" onclick="javascript:ManagerSystem.detailPage.employeeList({rid:${rid},did:${did},currentPage:1})">后退</button>
        </div>
    </div>
</div>
</body>
<%@ include file="common/bootstrap.jsp"%>
<script src="<%=request.getContextPath()%>/resources/scripts/ManagerSystem.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/resources/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</html>
